package com.nowcoder.community.service;

import com.nowcoder.community.entity.Message;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 朱哥
 * @since 2025-03-02
 */
public interface IMessageService extends IService<Message> {

    List<Message> findConversations(int userId, int offset, int limit);

    int findConversationCount(int userId);

    /**
     * 分页显示消息
     * @param conversationId
     * @param offset
     * @param limit
     * @return
     */
    List<Message> findLetters(String conversationId, int offset, int limit);

    int findLetterCount(String conversationId);

    int findLetterUnreadCount(int userId, String conversationId);


    /**
     * 添加私信
     * @param message
     * @return
     */
    int addMessage(Message message);

    /**
     * 将未读消息改成已读
     * @param ids
     * @return
     */
    int readMessage(List<Integer> ids);


    int findNoticeUnreadCount(int userId, String topic);

    Message findLatestNotice(int userId, String topic);

    int findNoticeCount(int userId, String topic);

    // 查询某个主题所包含的通知列表
    List<Message> findNotices(int userId, String topic, int offset, int limit);
}
